const path = require('path');

module.exports = {
    publicPath:'./',
    outputDir:'dist',
    assetsDir:'static',
    productionSourceMap:false,
    lintOnSave:false,
    configureWebpack: {
        resolve: {
            alias: {
                '@': path.resolve(__dirname, 'src'),
                '~': path.resolve(__dirname, 'packages')
            }
        }             
    },
    chainWebpack (config)
    {
        const oneOfsMap = config.module.rule('scss').oneOfs.store;

        oneOfsMap.forEach((item) =>
        {
            item
                .use('sass-resources-loader')
                .loader('sass-resources-loader')
                .options({
                    hoistUseStatements: true,
                    resources: './src/style/config.scss'
                })
                .end();
        });
        config.module
            .rule('images')
            .use('url-loader')
            .loader('url-loader')
            .tap((options) => Object.assign(options, { limit: 10000 }));
    },
    pages: {
        index: {
            entry: 'src/main.js',
            template: 'public/index.html',
            filename: 'index.html',
            title: 'MontUI',
            chunks: ['chunk-vendors', 'chunk-common', 'index']
        }
    },
    devServer:{
        // proxy:{
        //     '/v2/api':{
        //         target: 'http://192.168.0.29:5001',
        //         // target: 'http://192.168.1.7:5000',
        //         changeOrigin: true
        //     }
        // },
        port:'8088'
    }
};

